import request from '@/utils/request'

const base_teacher_API = '/eduservice/teacher'

// 按分页查询讲师
export const getTeacherList = (page, limit, teacherQuery) => request({
  url: `${base_teacher_API}/pageTeacherCondition/${page}/${limit}`,
  method: 'post',
  data: teacherQuery
})

// 条件查询讲师带分页
export default {
  getTeacherListByCondition(page, limit, teacherQuery) {
    return request({
      url: `${base_teacher_API}/pageTeacherCondition/${page}/${limit}`,
      method: 'get',
      data: teacherQuery
    })
  },

  // 根据id删除讲师
  removeTeacherById(id) {
    return request({
      url: `${base_teacher_API}/${id}`,
      method: 'delete'
    })
  },

  // 添加讲师
  saveTeacher(teacherInfo) {
    return request({
      url: `${base_teacher_API}/addTeacher`,
      method: 'post',
      data: teacherInfo
    })
  },

  // 根据id查询讲师
  selectTeacherById(id) {
    return request({
      url: `${base_teacher_API}/getTeacher/${id}`,
      method: 'get'
    })
  },

  // 根据讲师id修改讲师
  updateTeacherById(id, teacher) {
    return request({
      url: `${base_login_API}/updateTeacher/${id}`,
      method: 'put',
      data: teacher
    })
  },
  // 获得所有讲师
  selectAll() {
    return request({
      url: `${base_teacher_API}/selectAll`,
      method: 'get'
    })
  }
}



